<script>
    $(function() {
        $("a").button();
    });

    function checkInput(){
        if($("#username").val()==""){
            alert("กรุณากรอก username");
            $("#username").focus();
            return false;
        }

        if($("#password").val()==""){
            $("#password").focus();
            return false;
        }

        if($("#confirm_password").val()==""){
            $("#confirm_password").focus();
            return false;
        }

        if($("#password").val()!=$("#confirm_password").val()){
            alert("password ไม่ตรงกัน");
            $("#confirm_password").focus();
            return false;
        }

        if($("#consult_doctor_name").val()==""){
            $("#consult_doctor_name").focus();
            return false;
        }

        if($("#consult_doctor_hospital").val()==""){
            $("#consult_doctor_hospital").focus();
            return false;
        }   
    }
</script>

<div style="width: 100%;height: 100%;background-color:#222222" align="center">
    <div style="width: 80%;height: 100%;background-color:#eeeeee" align="center" class="ui-widget ui-corner-all">
<div style="width: 100%;padding: 10px" align="left"><a href="<?php echo url::base()?>/admin/doctor">กลับ</a></div>
    <br>
    <form method="post" action="<?php URL::base()?>doctor_add" target="" onsubmit="return checkInput()">
        <table class="ui-widget ui-widget-content ui-corner-all" >
            <thead><tr class="ui-widget-header"><td colspan="5">เพิ่มคุณหมอ</td></tr></thead>
            <tbody>
                <tr><td valign="top" style="padding-left: 10px">Username</td><td><input name="username" id="username" type="text"> </td><td style="color:red" align="left">*</td></tr>
                <tr><td valign="top" style="padding-left: 10px">Password</td><td><input type="password" id="password" name="password"></td><td style="color:red" align="left">*</td></tr>
                <tr><td valign="top" style="padding-left: 10px">Confirm Password</td><td><input type="password" id="confirm_password" name="confirm_password" align="left"> </td><td style="color:red">*</td></tr>
                <tr><td valign="top" style="padding-left: 10px">ชื่อ - นามสกุล</td><td><input name="consult_doctor_name" type="text"> </td><td style="color:red" align="left">*</td></tr>
                <tr><td valign="top" style="padding-left: 10px">โรงพยาบาล</td><td><input type="text" id="consult_doctor_hospital" name="consult_doctor_hospital" align="left"> </td><td style="color:red">*</td></tr>
                <tr><td valign="top" style="padding-left: 10px">IP camera</td><td><input type="text" id="consult_url" name="consult_url" > </td></tr>
                <tr><td valign="top" style="padding-left: 10px">เบอร์โทรศัพท์</td><td><input type="text" id="consult_tel" name="consult_tel" > </td></tr>
                <tr><td valign="top" style="padding-left: 10px">อีเมล์</td><td><input type="text" id="consult_email" name="consult_email" > </td></tr>
                <tr><td align="center" colspan="2"><input class="ui-button ui-widget ui-state-default ui-corner-all" type="submit" value="ยืนยัน"></td></tr>                
            </tbody>
            <input type="hidden" name="method" value="add">
        </table>   
    </form>
</div>
    </div>
